package com.lujieni.springbootlearn.beanFactoryPostProcessor;

import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;

/**
 *
 * MyBeanFactoryPostProcessor 必须先于 ConfigurationClassPostProcessor 执行,不然
 * SystemService 就无法被首先实例化
 *
 */
public class MyApplicationContextInitializer implements ApplicationContextInitializer {
    /**
     * Initialize the given application context.
     *
     * @param applicationContext the application to configure
     */
    public void initialize(ConfigurableApplicationContext applicationContext) {
        applicationContext.addBeanFactoryPostProcessor(new MyBeanFactoryPostProcessor());
    }
}
